﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


namespace AirlineProject.Models
{
    public class BillModels
    {
        private DataClassesProjectAirlineDataContext dc = new DataClassesProjectAirlineDataContext();
        public bool AddBill(string bill_id, int user_id, DateTime date)
        {
            bool kq = true;
            try
            {
                Bill b = new Bill();
                b.bill_id = bill_id;
                b.user_id = user_id;
                b.date = date;
                this.dc.Bills.InsertOnSubmit(b);
                this.dc.SubmitChanges();
            }
            catch
            {
                kq = false;
            }
            return kq;
        }
        public Bill InfoBill(string id)
        {
            return this.dc.Bills.Single(b=>b.bill_id.Equals(id));
        }
    }
}